#include <gmock/gmock.h>
#include <gtest/gtest.h>

#include "playlist/playlist.h"
#include "mitem/media_item.h"


namespace EngineCore
{
    class PlaylistTest : public ::testing::Test {
    protected:
        PlaylistTest() {
            first_ = std::make_shared<MediaItem>("http://first");
            second_ = std::make_shared<MediaItem>("http://second");

            mediaItems_.push_back(first_);
            mediaItems_.push_back(second_);

            playlist_ = Playlist(mediaItems_.begin(), mediaItems_.end());
        }

        Playlist playlist_;
        Playlist::MediaItemCollection mediaItems_;
        Playlist::MediaItemCollection::value_type first_, second_;
    };

    TEST_F( PlaylistTest, containsMediaItems ) {
        ASSERT_EQ(2, playlist_.count());
    }

    TEST_F( PlaylistTest, returnsIthMediaItem ) {
        ASSERT_EQ(first_, playlist_.get(0));
        ASSERT_EQ(second_, playlist_.get(1));
    }
}  // namespace EngineCore
